package com.example.stu.controller;


import com.example.stu.entity.Result;
import com.example.stu.pojo.ManagerLogin;
import com.example.stu.pojo.Student;
import com.example.stu.service.EmailService;
import com.example.stu.service.LoginVerifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Date: 2021/2/26
 * @Author: 黄先军
 * @Description: 登录验证用
 */
@RestController
@RequestMapping("/login")
public class LoginVerifyController {
    @Autowired
    private LoginVerifyService loginVerifyService;


    /**
     * 学生登录验证
     * @param
     * @return
     */
    @RequestMapping("stuLogin")
    public Result stuLogin(@RequestBody Student student) {
        return loginVerifyService.studentLoginVerify(student.getStuId(),student.getStuPwd());
    }

    /**
     * 管理员登录验证
     * @param
     * @return
     */
    @RequestMapping("manageLogin")
    public Result manageLogin(@RequestBody ManagerLogin managerLogin) {
       return loginVerifyService.manageLoginVerify(managerLogin.getMUsername(),managerLogin.getMPassword());
    }

}
